package com.wuzheng.wisgo.sanitation.cloud.repository.mapper.plan;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.wuzheng.wisgo.sanitation.cloud.model.plan.pojo.JobPlanDTO;
import com.wuzheng.wisgo.sanitation.cloud.model.plan.pojo.JobPlanDetailDTO;
import com.wuzheng.wisgo.sanitation.cloud.model.plan.pojo.JobPlanDetailRouteDTO;
import com.wuzheng.wisgo.sanitation.cloud.repository.builder.plan.JobPlanBuilder;
import com.wuzheng.wisgo.sanitation.cloud.repository.entity.plan.JobPlan;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * 道路作业计划 Mapper 接口
 *
 * @author hoipang
 * @since 2019-12-18
 */
public interface JobPlanMapper extends BaseMapper<JobPlan> {

    @SelectProvider(type = JobPlanBuilder.class, method = "buildConditionOfJobPlanDTOSql")
    List<JobPlanDTO> pageJobPlanDTOs(Page page, @Param("name") String name, @Param("code") String code);

    @SelectProvider(type = JobPlanBuilder.class, method = "buildConditionOfJobPlanDTOSql")
    List<JobPlanDTO> listJobPlanDTOs(@Param("name") String name, @Param("code") String code);

    @SelectProvider(type = JobPlanBuilder.class, method = "buildJobPlanRouteDTOSql")
    List<JobPlanDetailRouteDTO> listRoutes(@Param("code") String code);

    @SelectProvider(type = JobPlanBuilder.class, method = "buildJobPlanDetailDTOSql")
    JobPlanDetailDTO selectJobPlanDetailDTO(@Param("id") String id, @Param("code") String code);
}
